﻿using System;
using System.Collections.Generic;
using System.Configuration;
using System.Linq;
using System.Text;

namespace Xyz.DataObjects.Entity
{
    public static class EntityObjectFactory
    {
        private static readonly string ConnectionString;

        static EntityObjectFactory()
        {
            string connection = ConfigurationManager.AppSettings.Get("connection");
            ConnectionString = ConfigurationManager.ConnectionStrings[connection].ConnectionString;
        }

        public static XyzDBEntities CreateContext()
        {
            return new XyzDBEntities(ConnectionString);
        }
    }
}
